<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>接单后台管理</title>
    <link rel="stylesheet" type="text/css" href="../../static/admin/css/reset.css">
    <link rel="stylesheet" type="text/css" href="../../static/admin/css/main.css">
    <link rel="stylesheet" href="../../static/admin/css/jquery.pagination.css">
    <script type="text/javascript" src="../../static/admin/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="../../static/admin/js/jquery.pagination.min.js"></script>
    <link rel="stylesheet" href="../../static/admin/css/layui.css"  media="all">
</head>
<body>
<div class="breadcrub">
    <span style="float:left"> 当前位置：接单管理 > 所有订单</span>

    <div class="layui-input-inline" style="float:left;width:7%;margin-left: 20px;">
        <input name="find_time" type="text" class="layui-input" id="test1" placeholder="选择日期" style="height: 28px;margin-top: 4px;border-radius: 4px;margin-left: 440px;">
      </div>


    <form class="news_filter_form" style="float:right">
        <input type="text" placeholder="输入员工或者订单号查找订单" class="input_txt" name="keywords" id="keywords">
        <input type="submit" value="搜 索" class="input_sub">
    </form>
    <div class="form_group" name="find_name">
            <select class="sel_opt"  style="width:15%;float:right;margin-right:5px;height: 28px;margin-top: 4px;">
                <option >全部</option>
                {% for user in data.users %}
                <option >{{user.nick_name}}</option>
                {% endfor %}

            </select>
        </div>
</div>
<div class="pannel">
    <table class="common_table">
        <tr>
            <th width="5%">编号</th>
            <th width="8%">接单日期</th>
            <th width="10%">订单号</th>
            <th width="5%">供应商</th>
            <th width="10%">商品图片</th>
            <th width="5%">站点/店铺</th>
            <th width="10%">ASIN</th>
            <th width="5%">卖家/类型</th>
            <th width="5%">接单/下单金额</th>
            <th width="5%">操作员工</th>
            <th width="10%">备注</th>
            <th width="5%">订单状态</th>
            <th width="5%">详细信息</th>


        </tr>
        {% for news in data.news_list %}
            <tr>
                <td>{{ news.id }}</td>
                <td >{{ news.jiedan_time }}</td>
                <td>{{ news.ext1 }}</td>
                <td>{{ news.ext2 }}</td>
                <td><img src="/static/img/item_picture/{{news.item_picture}}"></td>
                {% if news.site_id==1%}
                <td>US</td>
                {% elif news.site_id==2%}
                <td>UK</td>
                {% elif news.site_id==3%}
                <td>DE</td>
                {% elif news.site_id==4%}
                <td>CA</td>
                {% endif %}
                 <td>{{ news.ASIN }}</td>
                {% if news.seller_id==1%}
                <td>卖家</td>
                {% else %}
                <td>买家</td>
                {% endif %}
                 <td>{{ news.amount }}</td>
                  <td>{{ news.staff_name }}</td>
                <td>{{ news.ps }}</td>
                {% if news.status_id==1%}
                <td>
                    <a href="#" class="review1_wxd">未下单</a>
                </td>
                {% elif news.status_id==2%}
                 <td>
                    <a href="#" class="review1_yxd">待上评</a>
                </td>
                {% elif news.status_id==3%}
                 <td>
                    <a href="#" class="review1_dsp">待结账</a>
                </td>

                 {% elif news.status_id==4%}
                 <td>
                    <a href="#" class="review1_yjz">已结账</a>
                </td>
                {% endif %}
                <td>
                    <a href="/admin/order_info?order_id={{news.id}}" class="review">查看</a>
                </td>
            </tr>
        {% endfor %}
    </table>
</div>

<div class="box">
    <div id="pagination" class="page"></div>
</div>
<script src="../../static/admin/js/layui.js" charset="utf-8"></script>
<script>
layui.use('laydate', function(){
  var laydate = layui.laydate;
 //常规用法
  laydate.render({
    elem: '#test1'
    ,type: 'datetime'
    ,done: function(value, date, endDate){
	       $("#keywords").attr("value",value);
            $(".input_sub").click()
	      }

  });

  //国际版
  laydate.render({
    elem: '#test1-1'
    ,lang: 'en'
  });
  //日期时间选择器
  laydate.render({
    elem: '#test5'
    ,type: 'datetime'
  });

  //日期范围
  laydate.render({
    elem: '#test6'
    ,range: true
  });

  //年范围
  laydate.render({
    elem: '#test7'
    ,type: 'year'
    ,range: true
  });

  //年月范围
  laydate.render({
    elem: '#test8'
    ,type: 'month'
    ,range: true
  });

  //时间范围
  laydate.render({
    elem: '#test9'
    ,type: 'time'
    ,range: true
  });

  //日期时间范围
  laydate.render({
    elem: '#test10'
    ,type: 'datetime'
    ,range: true
  });

  //自定义格式
  laydate.render({
    elem: '#test11'
    ,format: 'yyyy年MM月dd日'
  });
  laydate.render({
    elem: '#test12'
    ,format: 'dd/MM/yyyy'
  });
  laydate.render({
    elem: '#test13'
    ,format: 'yyyyMMdd'
  });
  laydate.render({
    elem: '#test14'
    ,type: 'time'
    ,format: 'H点m分'
  });
  laydate.render({
    elem: '#test15'
    ,type: 'month'
    ,range: '~'
    ,format: 'yyyy-MM'
  });
  laydate.render({
    elem: '#test16'
    ,type: 'datetime'
    ,range: '到'
    ,format: 'yyyy年M月d日H时m分s秒'
  });

  //开启公历节日
  laydate.render({
    elem: '#test17'
    ,calendar: true
  });

  //自定义重要日
  laydate.render({
    elem: '#test18'
    ,mark: {
      '0-10-14': '生日'
      ,'0-12-31': '跨年' //每年的日期
      ,'0-0-10': '工资' //每月某天
      ,'0-0-15': '月中'
      ,'2017-8-15': '' //如果为空字符，则默认显示数字+徽章
      ,'2099-10-14': '呵呵'
    }
    ,done: function(value, date){
      if(date.year === 2017 && date.month === 8 && date.date === 15){ //点击2017年8月15日，弹出提示语
        layer.msg('这一天是：中国人民抗日战争胜利72周年');
      }
    }
  });

  //限定可选日期
  var ins22 = laydate.render({
    elem: '#test-limit1'
    ,min: '2016-10-14'
    ,max: '2080-10-14'
    ,ready: function(){
      ins22.hint('日期可选值设定在 <br> 2016-10-14 到 2080-10-14');
    }
  });

  //前后若干天可选，这里以7天为例
  laydate.render({
    elem: '#test-limit2'
    ,min: -7
    ,max: 7
  });

  //限定可选时间
  laydate.render({
    elem: '#test-limit3'
    ,type: 'time'
    ,min: '09:30:00'
    ,max: '17:30:00'
    ,btns: ['clear', 'confirm']
  });

  //同时绑定多个
  lay('.test-item').each(function(){
    laydate.render({
      elem: this
      ,trigger: 'click'
    });
  });

  //初始赋值
  laydate.render({
    elem: '#test19'
    ,value: '1989-10-14'
    ,isInitValue: true
  });

  //选中后的回调
  laydate.render({
    elem: '#test20'
    ,done: function(value, date){
      layer.alert('你选择的日期是：' + value + '<br>获得的对象是' + JSON.stringify(date));
    }
  });

  //日期切换的回调
  laydate.render({
    elem: '#test21'
    ,change: function(value, date){
      layer.msg('你选择的日期是：' + value + '<br><br>获得的对象是' + JSON.stringify(date));
    }
  });
  //不出现底部栏
  laydate.render({
    elem: '#test22'
    ,showBottom: false
  });

  //只出现确定按钮
  laydate.render({
    elem: '#test23'
    ,btns: ['confirm']
  });

  //自定义事件
  laydate.render({
    elem: '#test24'
    ,trigger: 'mousedown'
  });

  //点我触发
  laydate.render({
    elem: '#test25'
    ,eventElem: '#test25-1'
    ,trigger: 'click'
  });

  //双击我触发
  lay('#test26-1').on('dblclick', function(){
    laydate.render({
      elem: '#test26'
      ,show: true
      ,closeStop: '#test26-1'
    });
  });

  //日期只读
  laydate.render({
    elem: '#test27'
    ,trigger: 'click'
  });

  //非input元素
  laydate.render({
    elem: '#test28'
  });

  //墨绿主题
  laydate.render({
    elem: '#test29'
    ,theme: 'molv'
  });

  //自定义颜色
  laydate.render({
    elem: '#test30'
    ,theme: '#393D49'
  });

  //格子主题
  laydate.render({
    elem: '#test31'
    ,theme: 'grid'
  });


  //直接嵌套显示
  laydate.render({
    elem: '#test-n1'
    ,position: 'static'
  });
  laydate.render({
    elem: '#test-n2'
    ,position: 'static'
    ,lang: 'en'
  });
  laydate.render({
    elem: '#test-n3'
    ,type: 'month'
    ,position: 'static'
  });
  laydate.render({
    elem: '#test-n4'
    ,type: 'time'
    ,position: 'static'
  });
});
</script>

<script>
    $(function () {
        $("#pagination").pagination({
            currentPage: {{ data.current_page }},
            totalPage: {{ data.total_page }},

            callback: function (current) {
                window.location = '/admin/news_review?keywords={{data.keyw}}&p=' + current
            }
        });
    });
</script>
<script>
var t=1
    $(".sel_opt").click(function(){
        if(t%2==0){
        var people=$("select[class='sel_opt'] option:selected").text()
        console.log(people)
        if(people=='全部'){
            $(".input_sub").click()
        }
        else{
        $("#keywords").attr("value",people);
        $(".input_sub").click()
        }


        }
        t+=1
    })
</script>


</body>
</html>